package com.DTC;

import java.io.Serializable;
import java.util.ArrayList;

public class D implements Serializable{
    private static int index=0;
    public ArrayList<IrisEntry> data;
    public int state; //0是waiting,1是doing,2是over
    public int attrIndex;
    public int name;
    public Double gain;
    public Double mid;
    public D(){     //生成一个空D
        this.name=-1;
    }
    public D(ArrayList<IrisEntry> data,int attrIndex, int name){
        state = 0;
        this.data = data;
        this.attrIndex = attrIndex;
        this.name = name;
    }
    public synchronized ArrayList<IrisEntry> getData(){
        return data;
    }
    public synchronized int getAttrIndex(){
        return attrIndex;
    }
    public synchronized int getName(){
        return name;
    }
    public synchronized int getState(){
        return state;
    }
    public synchronized Double getGain(){
        return gain;
    }
    public synchronized Double getMid(){
        return mid;
    }
    public synchronized int setState(int state){
        this.state=state;
        return this.state;
    }
    public String toString(){
        return "我的名字是"+name;
    }
    public static D allocateD(ArrayList<IrisEntry> data,int attrIndex){
        return new D(data,attrIndex,index++);
    }
}
